<?php defined('RUN_KATANA') or die('Restricted access'); 
if($shop->getOrders())
{
	$out = '';
	
	foreach($shop->getShopQuestions() as $question)
	{
		$out .= '<tr class="items">';
			$out .= '<td class="first left">&nbsp;'.$question->getId().'</td>';
			$out .= '<td class="bold">'.$question->getTitle().'</td>';
			$out .= '<td class="right">'.$question->getResponsesCount().'&nbsp;&nbsp;</td>';
			$out .= '<td></td>';
			$out .= '<td></td>';
		$out .= '</tr>';
		
		if($question->getAnswers())
		{
			foreach($question->getAnswers() as $answer)
			{
				$out .= '<tr class="items">';
					$out .= '<td valign="top" class="first left top">&nbsp;'.$question->getId().':'.$answer->getId().'</td>';
					$out .= '<td valign="top" class="top">'.$answer->getTitle().'</td>';
					$out .= '<td valign="top" class="right top">'.$answer->getResponsesCount().'&nbsp;&nbsp;</td>';
					$out .= '<td valign="top" class="right top">'.$question->getPercent($answer->getResponsesCount()).'&nbsp; %&nbsp;&nbsp;</td>';
					$out .= '<td valign="top" class="top">';
					if($answer->getType() == 1)
					{
						$out .= '<a class="command" onclick="jQuery(\'#values'.$answer->getId().'\').toggle(\'blind\');">'.ucfirst($txt->getWord('display').' '.$txt->getWord('responses')).'</a>';
						$vals .= '<div id="values'.$answer->getId().'" style="display:none;">';
						$vals .= 	'<p>';
						foreach($answer->getResponses() as $response)
						{
							if($response->getAnswerValue() != '')
							{ $vals .= 	'-&nbsp;'.$response->getAnswerValue().'<br />'; }
						}
						$vals .= 	'</p>';
						$vals .= '</div>';
					}
					$out .= '</td>';
				$out .= '</tr>';
				
				if($vals != '')
				{
					$out .= '<tr class="items">';
						$out .= '<td class="first left">&nbsp;</td>';
						$out .= '<td class="bold">&nbsp;</td>';
						$out .= '<td class="right">&nbsp;</td>';
						$out .= '<td>&nbsp;</td>';
						$out .= '<td>'.$vals.'</td>';
					$out .= '</tr>';
				}
			}
		}
	}
	echo $out;
}
?>